<?php
$dirList = explode ( '/', $_SERVER ['PHP_SELF'] );
$document_root = $_SERVER ["DOCUMENT_ROOT"];
require "$document_root/$dirList[1]/src/conf/conf.php";

$connMng = new ConnManger ( $db_conf, $mem_conf );
$connPar = $connMng->getConn_parser();

$newsName = $_GET['newsName'];

$newsList = News_news_info_DAO::getListByNewsNameOrId($newsName, $connPar);

$return_arr = array();
foreach ($newsList as $newsRecord){
	//$sir_goods_buy = new Sir_shops_order_info(array());
	$news_array = array();
	$news_array[] = $newsRecord->getId();
	$news_array[] = $newsRecord->getTitle();
	$return_arr[] = $news_array;
}

echo json_encode($return_arr);
